package cn.ylhx.venue.proposeSite.service.impl;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import cn.ylhx.venue.background.entity.Background;
import cn.ylhx.venue.proposeSite.dao.ProposeSiteDao;
import cn.ylhx.venue.proposeSite.entity.SiteFloor;
import cn.ylhx.venue.proposeSite.entity.SiteService;
import cn.ylhx.venue.proposeSite.entity.SiteTraffic;
import cn.ylhx.venue.proposeSite.service.ProposeSiteService;
import cn.ylhx.venue.site.entity.Site_Message;
@Service
public class ProposeSiteServiceImpl implements ProposeSiteService {
	@Resource
	private ProposeSiteDao proposeSiteDao;
	@Override
	public Map<String,Object> findSiteById(Integer id) {
		Site_Message site_Message=proposeSiteDao.findSiteById(id);
		SiteFloor siteFloor=proposeSiteDao.findFloorById(id);
		SiteService siteService=proposeSiteDao.findServiceById(id);
		SiteTraffic sitetraffic=proposeSiteDao.findTrafficById(id);
		Map<String,Object>map=new HashMap<>();
		map.put("site_Message", site_Message);
		map.put("sitetraffic", sitetraffic);
		map.put("siteFloor", siteFloor);
		map.put("siteService", siteService);
		return map;
	}
	@Override
	public Map<String,Object> findSiteByDate(Integer id,String ProDate) {
		String tableName="site_space_"+id;
		List<Background> list_background=proposeSiteDao.findSiteByDate(tableName, ProDate);
		List<Map<String,Object>> list_session=proposeSiteDao.findSessionById(tableName, id);
		List<Map<String,Object>> list_timeSlice=proposeSiteDao.findtimeSliceById(tableName, id);
		Map<String,Object> map=new HashMap<String,Object>();
		map.put("list_background", list_background);
		map.put("list_session", list_session);
		map.put("list_timeSlice", list_timeSlice);
		return map;
	}
	
	

}
